/*
 * @Descripttion: 类的定义：修饰符
 * @Author: ziwei
 * @Date: 2022-07-03 19:39:12
 * @LastEditors: ziwei
 * @LastEditTime: 2022-07-03 20:02:28
 */
class Father{
    static fatherName:string = 'fatherName';
    toString(){}
    public name:string;//public自己 自己的子类 和其它类都能访问
    protected age:number;//protedted 自己和自己的子类能访问，其它类不能访问
    private money:number;//private 自己能访问，子类和其它类不能访问
    constructor(name:string,age:number,money:number){
        this.name = name
        this.age = age
        this.money = money
    }
    getName():string{
        return this.name
    }
}

class Child extends Father{
    static childName:string = 'childName'
    constructor(name:string,age:number,money:number){
        super(name,age,money)
    }
    toString(){
        super.toString()
        console.log('Child');
    }
    desc(){
        console.log(this.name,this.age);
    }
}

let child = new Child('zhufeng',11,1)
console.log(child.name);
Child.childName
Child.fatherName
Child.toString()
